package com.wisewin.circle.api.controller.task;

import com.wisewin.circle.service.GroupService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Scheduler {
    final static Logger log = LoggerFactory.getLogger(Scheduler.class);

    @Autowired
    private GroupService groupService;

    // 定时处理拼团是否结束
    @Scheduled(cron = "0 0/15 * * * ?")
    public void dealGroupOrder() {
        log.info("==============处理拼团是否结束定时器开始=================");
        groupService.dealGroupOrder();
        log.info("==============处理拼团是否结束定时器结束=================");
    }
}
